package com.xy.controller.product;

import com.xy.common.base.ApiBaseResponse;

import com.xy.entity.product.Product;
import com.xy.repository.ProductRespository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import java.util.Set;


@Api(value = "产品详情Controller", description = "产品详情")
@RestController
@RequestMapping(value = "api/particulars")
public class ParticularsController {
    @Autowired
    private ProductRespository productRespository;


    @ApiOperation("产品详情")
    @GetMapping("/Getparticulars")
    @ResponseStatus(HttpStatus.OK)
    public ResponseEntity<?> Getparticulars(@RequestParam("uuid") String uuid) {


        Set<Product> set = productRespository.findAllByUuid(uuid);


        return ResponseEntity.ok(ApiBaseResponse.fromHttpStatus(HttpStatus.OK, set));
    }
}
